﻿Public Class frmVerCartasAtaques

    Private Sub btnAceptar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAceptar.Click
        Dim cartaUsada As clHabilidad = TryCast(Me.lbVerCartasAtaques.SelectedItem, clHabilidad)
        If ListaTemporal.Contains(cartaUsada) Then
            If cartaUsada.Nombre = "Ataque" Then
                Me.devolver_efecto()
                Me.devolver_tipo()
                Me.Visible = False
            Else
                MessageBox.Show("no va poder usar a volver")
                ListaTemporal.Remove(cartaUsada)
                lbVerCartasAtaques.DataSource = ListaTemporal
                Me.devolver_efecto()
                Me.devolver_tipo()
                Me.Visible = False
            End If
        End If
    End Sub

    Public Efecto As Decimal
    Public Tipo As String
    Public Sub devolver_efecto() 'Valor del plus
        Efecto = (TryCast(Me.lbVerCartasAtaques.SelectedItem, clHabilidad).llamar_Efecto)
    End Sub
    Public Sub devolver_tipo() 'Tipo de valor que sube (ADVS)
        Tipo = (TryCast(Me.lbVerCartasAtaques.SelectedItem, clHabilidad).llamar_Tipo)
    End Sub
    Private Sub frmVerCartasAtaques_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Me.lbVerCartasAtaques.DataSource = ListaTemporal
        Me.lbVerCartasAtaques.DisplayMember = "nombre"

    End Sub

    Private Sub lbVerCartasAtaques_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbVerCartasAtaques.SelectedValueChanged
        Me.pbCarta.Image = TryCast(lbVerCartasAtaques.SelectedItem, clHabilidad).llamar_Imagen

    End Sub

    Private Sub btnCancelar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

        Me.Close()
    End Sub

    

End Class